package hd3.examples;

import hdapi3.HD3;

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class SiteFetchTreesExample extends HttpServlet {
	private static final long serialVersionUID = 1L;

	@Override
	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		Utility.initHDAPISettings(this.getServletContext());
		response.setContentType("application/json");
		HD3 hd = new HD3();
		hd.siteFetchTrees();
		ServletOutputStream out = response.getOutputStream();
		out.write(hd.getRawReply());
		
		out.close();
	}
}
